/*
  Copyright (c) 2012, Qusai Al Abdallah and Omar Fawzi 
 * All rights reserved.

  Redistribution and use in source and binary forms, with or without modification, 
  are permitted provided that the following conditions are met:

    - Redistributions of source code must retain the above copyright notice, this 
       list of conditions and the following disclaimer.
       
    - Redistributions in binary form must reproduce the above copyright notice, 
       this list of conditions and the following disclaimer in the documentation 
       and/or other materials provided with the distribution.
       

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
  SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
*/

package primerdb;

public class Primer {
    
    /**
     * Constructors for Primer
     */
    public Primer() {
    }
    

        
    public Primer(String name, String annTemp, String freezer, String target, String conc,
            String date, String label, String sequence, String notes, String project, int folderId) {
       this(name, annTemp, freezer, target, conc, date, label, sequence, notes, project, folderId, -1);
    }

    
    public Primer(String name, String annTemp, String freezer, String target, String conc,
            String date, String label, String sequence, String notes, String project, int folderId, int id) {
        this.name = name;
        this.annTemp = annTemp;
        this.freezer = freezer;
        this.target = target;
        this.conc = conc;
        this.date = date;
        this.label = label;
        this.sequence = sequence;
        this.notes = notes;
	this.project = project;
        this.folderId = folderId;
        this.id = id;
    }

    
    
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getName() {
        return name;
    }
     public void setProject(String project) {
        this.project = project;
    }
    
    public String getProject() {
        return project;
    }
    
    public void setFolderId(int folderId) {
       this.folderId = folderId;
    }
    
    public int getFolderId() {
       return folderId;
    }
    
    public void setFreezer(String freezer) {
        this.freezer = freezer;
    }
    
    public String getFreezer() {
        return freezer;    
    }
   
    public void setLabel(String label) {
        this.label = label;
    }
    
    public String getLabel() {
        return label;    
    }

    public void setDate(String date) {
        this.date = date;
    }
    
    public String getDate() {
        return date;    
    }    

    public void setTarget(String target) {
        this.target = target;
    }
    
    public String getTarget() {
        return target;    
    }
    
        public void setSequence(String sequence) {
        this.sequence = sequence;
    }
    
    public String getSequence() {
        return sequence;    
    }
    
    public void setNotes(String notes) {
        this.notes = notes;
    }
    
    public String getNotes() {
        return notes;    
    }

    public void setAnnTemp(String annTemp) {
        this.annTemp = annTemp;
    }
    
    public String getAnnTemp() {
        return annTemp;    
    }

    public void setConc(String conc) {
        this.conc = conc;
    }
    
    public String getConc() {
        return conc;    
    }

    public void setId(int id) {
        this.id = id;
    }
    
    public int getId() {
       return id;
    }
    
   
    
    
    public String toString() {
       return name + " " + sequence;
    }
    
    
    /*
    public int hashCode() {
        int value = 1;
        value = value*PRIMENO + (lastName == null ? 0 : lastName.hashCode());
        value = value*PRIMENO + (middleName == null ? 0 : middleName.hashCode());
        value = value*PRIMENO + (firstName == null ? 0 : firstName.hashCode());
        value = value*PRIMENO + (phone == null ? 0 : phone.hashCode());
        value = value*PRIMENO + (email == null ? 0 : email.hashCode());
        value = value*PRIMENO + (address1 == null ? 0 : address1.hashCode());
        value = value*PRIMENO + (address2 == null ? 0 : address2.hashCode());
        value = value*PRIMENO + (city == null ? 0 : city.hashCode());
        value = value*PRIMENO + (state == null ? 0 : state.hashCode());
        value = value*PRIMENO + (postalCode == null ? 0 : postalCode.hashCode());
        value = value*PRIMENO + (country == null ? 0 : country.hashCode());
        
        // don't use the id since this is generated by db
        
        return value;
    }
    
    
    public boolean equals(Object other) {
        boolean bEqual = false;
        if (this == other) {
            bEqual = true;
        } else if (other instanceof Address) {
            Address thatAddress = (Address) other;
            if ((lastName == null ? thatAddress.lastName == null : lastName.equalsIgnoreCase(thatAddress.lastName)) &&
                    (firstName == null ? thatAddress.firstName == null : firstName.equalsIgnoreCase(thatAddress.firstName)) && 
                    (middleName == null ? thatAddress.middleName == null : middleName.equalsIgnoreCase(thatAddress.middleName)) &&
                    (phone == null ? thatAddress.phone == null : phone.equalsIgnoreCase(thatAddress.phone)) &&
                    (email == null ? thatAddress.email == null : email.equalsIgnoreCase(thatAddress.email)) &&
                    (address1 == null ? thatAddress.address1 == null : address1.equalsIgnoreCase(thatAddress.address1)) &&
                    (address2 == null ? thatAddress.address2 == null : address2.equalsIgnoreCase(thatAddress.address2)) &&
                    (city == null ? thatAddress.city == null : city.equalsIgnoreCase(thatAddress.city)) &&
                    (state == null ? thatAddress.state == null : state.equalsIgnoreCase(thatAddress.state)) &&
                    (postalCode == null ? thatAddress.postalCode == null : postalCode.equalsIgnoreCase(thatAddress.postalCode)) &&
                    (country == null ? thatAddress.country == null : country.equalsIgnoreCase(thatAddress.country))) {
                // don't use id in determining equality
                
                bEqual = true;
            }
        }
        
        return bEqual;
    }
   */
    
    private String name;
    private String freezer;
    private String label;
    private String date;
    private String target;
    private String sequence;
    private String notes;
    private String annTemp;
    private String conc;
    private String project;
    private int folderId;
    private int id;
		
}
